<template>
  <div class="banner-item">
    <div v-if="navigator === 'mobile'" class="h5">
      <div
        v-if="componentData.coverImage || componentData.coverImageApp"
        :style="{
          backgroundImage: `url(${componentData.coverImageApp || componentData.coverImage})`,
        }"
        class="bg"
      >
        <img
          v-if="componentData.coverImage || componentData.coverImageApp"
          :src="componentData.coverImageApp || componentData.coverImage"
          alt="solution"
        />
      </div>
      <p v-if="componentData.titleZh">{{ componentData.titleZh }}</p>
    </div>
    <div v-else class="pc">
      <img v-if="componentData.coverImage" :src="componentData.coverImage" alt="solution" />
      <p v-if="componentData.titleZh">{{ componentData.titleZh }}</p>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    componentData: {
      type: Object,
      default: () => ({}),
    },
    // 设备型号
    navigator: {
      type: String,
      default: '',
    },
  },
  data() {
    return {}
  },
  computed: {},
  methods: {},
}
</script>

<style lang="less" scoped>
@import '~assets/var';

.banner-item {
  .h5 {
    position: relative;
    background-color: #fff;

    .bg {
      min-height: 375px;
      background-repeat: no-repeat;
      background-size: cover;
      background-position: center;

      img {
        width: 100%;
        display: block;
        opacity: 0;
      }
    }

    p {
      position: absolute;
      width: 280px;
      .ft(24);

      line-height: 20px;
      background-color: rgba(0, 0, 0, 0.5);
      left: 0;
      top: 100px;
      padding: 20px;
      color: #fff;
    }
  }

  .pc {
    background-color: #fff;
    border: 1px dashed #e0e4ec;
    position: relative;
    overflow: hidden;
    min-height: 100px;

    img {
      width: 100%;
      display: block;
    }

    p {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      background-color: rgba(0, 0, 0, 0.5);
      left: 0;
      color: #fff;
      .width(1141);
      .pd(70, 0, 70, 360);
      .ft(18);
      .lineH(30);
    }
  }
}
</style>
